package com.xqboss.apps.vo.hama;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.math.BigDecimal;

@Data
@ApiModel("队长列表")
public class HamaHelpAdminVO {

    @ApiModelProperty(value = "ID")
    private Long id;

    @ApiModelProperty(value = "队长手机号")
    private String mobile;

    @ApiModelProperty(value = "队长用户id")
    private Long adminUserId;

    @ApiModelProperty(value = "队长用户名称")
    private String adminUserName;

    @ApiModelProperty(value = "有效队友（包括直推和间推）")
    private Long trueMembers;

    @ApiModelProperty(value = "无效队友（包括直推和间推）")
    private Long falseMembers;

    @ApiModelProperty(value = "直推好友")
    private Integer directMembers;

    @ApiModelProperty(value = "二级好友(间推)")
    private Integer inDirectMembers;

    @ApiModelProperty(value = "空投总速率（时）（包括直推和间推）")
    private BigDecimal airdropSpeed;

    @ApiModelProperty(value = "累计已空投（力豆）（包括直推和间推）")
    private BigDecimal airdropTotal;

    /**
     * 设置助力速率（直推助力总和 + （间推助力总和 * 间推系数））
     *
     * @param basicSpeed 直推助力总和
     * @param basicSpeedIndirect 间推助力总和
     * @param factor 间推系数
     */
    public void setAirdropSpeed(BigDecimal basicSpeed, BigDecimal basicSpeedIndirect, BigDecimal factor) {
        basicSpeed= basicSpeed ==null?BigDecimal.ZERO:basicSpeed;
        basicSpeedIndirect= basicSpeedIndirect ==null?BigDecimal.ZERO:basicSpeedIndirect;
        factor= factor ==null?BigDecimal.ZERO:factor;
        basicSpeed = basicSpeed.add(basicSpeedIndirect.multiply(factor));
        this.airdropSpeed = basicSpeed;
    }

    public void setAirdropTotal(BigDecimal airdropTotal,BigDecimal airdropTotalIndirect) {
        airdropTotal= airdropTotal ==null?BigDecimal.ZERO:airdropTotal;
        airdropTotalIndirect= airdropTotalIndirect ==null?BigDecimal.ZERO:airdropTotalIndirect;
        this.airdropTotal = airdropTotal.add(airdropTotalIndirect);
    }
}
